﻿
namespace PaceR.Core.Interfaces.EntityProcessing
{
    /// <summary>
    /// A command performed on an entity
    /// </summary>
    /// <typeparam name="T">Type of entity to perform the command on</typeparam>
    public interface IEntityCommand<T, R>
    {
        /// <summary>
        /// The receiver of the command
        /// </summary>
        R Receiver { get; }
        /// <summary>
        /// Executes The command
        /// </summary>
        /// <param name="entity">Entity to execute command on</param>
        /// <returns>Results of entity command</returns>
        IResult<T> Execute(T entity);
        /// <summary>
        /// Undo the command
        /// </summary>
        /// <param name="entity">Entity to execute command on</param>
        /// <returns>Results of entity command</returns>
        IResult<T> UnExecute(T entity);
    }
}
